home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / STRLWR.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  1KB  |  68 lines

  1. StdGrp        group    StdLib, StdData
  2. ;
  3. StdData        segment    para public 'sldata'
  4.         extrn    $lwrtbl:byte
  5. StdData        ends
  6. ;
  7. stdlib        segment    para public 'slcode'
  8.         assume    cs:StdGrp
  9. ;
  10.         extrn    sl_strdup:far
  11. ;
  12. ; strlwr- Converts to lower case all upper case characters in the string
  13. ;      pointed at by es:di.
  14. ;
  15. ; strlwrm- Same as above except it creates a new string then converts the
  16. ;       characters in the new string.  The original string is unchanged.
  17. ;
  18. ; inputs:
  19. ;        es:di-  Buffer for destination string.
  20. ;
  21. ; outputs:
  22. ;        es:di-  Points at converted string (points at new string
  23. ;            for strupr2).
  24. ;
  25.         public    sl_strlwr
  26. ;
  27. sl_strlwr    proc    far
  28.         push    es
  29.         push    ds
  30.         push    ax
  31.         push    bx
  32.         pushf
  33.         push    si
  34.         push    di
  35. ;
  36.         mov    si, es
  37.         mov    ds, si
  38.         mov    si, di
  39.         lea    bx, StdGrp:$lwrtbl
  40. ToUprLp:    lodsb
  41.         xlat     StdGrp:$lwrtbl
  42.         stosb
  43.         cmp    al, 0
  44.         jne    ToUprLp
  45. ;
  46.         pop    di
  47.         pop    si
  48.         popf
  49.         pop    bx
  50.         pop    ax
  51.         pop    ds
  52.         pop    es
  53.         ret
  54. sl_strlwr    endp
  55. ;
  56. ;
  57.         public    sl_strlwrm
  58. ;
  59. sl_strlwrm    proc    far
  60.         call    sl_strdup
  61.         jc    RetFar            ;Return if error.
  62.         jmp    near ptr sl_strlwr
  63. RetFar:        ret
  64. sl_strlwrm    endp
  65. ;
  66. stdlib        ends
  67.         end
  68.